const { PureComponent } = require("react");

// hoc
const title = title => {
  return WC => class extends PureComponent {
    componentDidMount() {
      document.title = title || 'ml';
    }
    render() {
      return (
        <WC {...this.props}></WC>
      )
    }
  }
}

// @title("hello react")
@title()
class DemoA extends PureComponent {
  render() {
    console.log(this.props);
    return (
      <div>
        <h1>类组件</h1>
      </div>
    )
  }
}

export default DemoA;